<%@page language="java" pageEncoding="utf-8" contentType="text/html; charset=utf-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>超市订单管理系统</title>
    <link type="text/css" rel="stylesheet" href="css/style.css"/>
    <link type="text/css" rel="stylesheet" href="css/public.css"/>
</head>
<body>
<div class="location">
    <strong>你现在所在的位置是:</strong>
    <span>订单管理页面 >> 订单添加页面</span>
</div>

<div class="${updateClass }">${updateMsg }</div>
<c:remove var="updateMsg" scope="session"/>
<c:remove var="updateClass" scope="session"/>

<div class="providerAdd">
    <form id="billForm">
        <input type="hidden" name="method" value="billAdd">
        <div>
            <label for="idName">订单编码：</label>
            <input type="text" name="idName" id="idName" value="">
        </div>
        <div>
            <label for="name">商品名称：</label>
            <input type="text" name="name" id="name" value="">
            <font color="red"></font>
        </div>
        <div>
            <label for=money>总金额：</label>
            <input type="text" name="money" id="money" value="">
            <font color="red"></font>
        </div>
        <div>
            <label for="provider">供应商：</label>
            <!-- 列出所有的供货商 -->
            <select name="provider" id="provider">
            	<option value="">请选择</option>
            	<c:forEach items="${paProvider.items  }" var="t">
               	<option value="${t.name }" <c:if test="${provider == t.name }">selected</c:if>>${t.name }</option>
               	</c:forEach>
            </select>
            <font color="red"></font>
        </div>
        <div>
            <label>是否付款：</label>
               <select name="state" id="state">
               		<option value="">请选择</option>
                    <option value="2">未付款</option>
                    <option value="1">已付款</option>
               </select>
        </div>
        <div class="providerAddBtn">
            <input type="button" name="save" id="save" value="保存">
            <input type="button" id="back" name="back" value="返回">
        </div>
    </form>
</div>

<!-- 保存当前页的路径 -->
<c:set var="urlLoading" value="${pageContext.request.contextPath}/page/bill/orderAdd.jsp" scope="session"></c:set>

</body>
<script type="text/javascript">
$(".providerAddBtn :button[value='保存']").bind("click", function() {
	/* 表单验证 */
	
	/* 确认提示 */
	if(!confirm("确定保存新订单信息吗?")) return;
	
	toJump("${pageContext.request.contextPath}/bill/orderAdd",
			$("#billForm").serialize() + "&page=orderDetail.jsp", "#mainframe");
});
$(".providerAddBtn :button[value='返回']").bind("click", function() {
	toJump("${pageContext.request.contextPath}/bill/query", 
			"curr=${paBill.curr}", "#mainframe");
});
</script>
</html>
